package com.example.design.shejimoshi.action.oberver.同步阻塞的实现方式;

import java.util.ArrayList;
import java.util.List;

public class UserController {
//    private UserService userService;
    private List<RegObserver> regObservers = new ArrayList<>();

    public void setRegObservers(List<RegObserver> observers) {
        regObservers.addAll(observers);
    }

    public void register(String telephone, String password) {
//        long userId = userService.register(telephone, password);
        long userId = 0L;

        for (RegObserver observer : regObservers) {
            observer.handlerRegSuccess(userId);
        }
    }
}
